subroutine Right_expansion_wave(u1,p1,rho1,u2,p2,rho2,h_v,t_v)
implicit  none

    real(8) u1,p1,rho1,u2,p2,rho2
    real(8) h_v,t_v!head velocity,tial velocity 
    real(8) c1,c2
    real(8),parameter::gamma=1.4d0
    
    c1=dsqrt(gamma*p1/rho1)
    h_v=u1+c1
    !c2=(gamma-1.d0)/(2.d0*gamma)
    !c2=c1*(p2/p1)**c2
    c2=c1-(gamma-1.d0)*(u1-u2)/2.d0
    t_v=u2+c2
    !rho2=1.d0/gamma
    !rho2=rho1*(p2/p1)**rho2
    rho2=gamma*p2/(c2**2)


endsubroutine